#ifndef RGUI_WINDOW_HPP
#define RGUI_WINDOW_HPP

#include "Rectangle.hpp"
#include "Text.hpp"

#include "RenderObject.hpp"

namespace rgui
{

class Window : public RenderObject
{
public:
	Window(const rgui::vec2f &position, const rgui::vec2f &size, const std::wstring &title = std::wstring());

	const rgui::vec2f&				getPosition();
	const rgui::vec2f&				getSize();
	const std::wstring&				getTitle();

	void							setPosition(const rgui::vec2f &position);
	void							setSize(const rgui::vec2f &size);
	void							setTitle(const std::wstring &title);

	// Check if the given position is inside the rectangle
	bool							contains(const rgui::vec2f &position);

	void							onMousePressed(const rgui::vec2i &cursorPosition){}
	void							onMouseReleased(const rgui::vec2i &cursorPosition){}
	virtual void					onClick(const rgui::vec2i &cursorPosition) = 0;
	virtual void					update(const rgui::vec2i &cursorPosition) = 0;
	virtual void					render(const rgui::RenderEffect &renderEffect = rgui::RenderEffect()) = 0;
protected:
	rgui::Rectangle mRectangle;
	rgui::Text mTitle;
};

}

#endif